package com.training.java.core.exceptionhandling;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class ExceptionDemo2 {

	public static void main(String[] args) 
	{
      try{
    	   FileWriter fileWriter = new FileWriter("D:\\javatrainingbyreenu.txt");
    	   PrintWriter out = new PrintWriter(fileWriter);
    	   out.write("This is my new exception handling file.\r\n");
    	   out.write("\nAnother thing i want to add here .\r\n");
    	   out.write("\nTrying again for next line.\r\n");
    	   out.close();
      }
      catch(IOException ex)
      {
    	  ex.printStackTrace();
      }
       
	}

}
